load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "aggmetric",
    srcs = [
        "agg_metric.go",
        "counter.go",
        "gauge.go",
        "histogram.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/util/metric/aggmetric",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/metric",
        "//pkg/util/metric/tick",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//proto",
        "@com_github_google_btree//:btree",
        "@com_github_prometheus_client_model//go",
    ],
)

go_test(
    name = "aggmetric_test",
    size = "small",
    srcs = ["agg_metric_test.go"],
    data = glob(["testdata/**"]),
    embed = [":aggmetric"],
    deps = [
        "//pkg/base",
        "//pkg/roachpb",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/echotest",
        "//pkg/util/leaktest",
        "//pkg/util/metric",
        "@com_github_prometheus_client_model//go",
        "@com_github_prometheus_common//expfmt",
        "@com_github_stretchr_testify//require",
    ],
)
